/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.personal.service;

import org.springblade.modules.classes.vo.ClassesVO;
import org.springblade.modules.personal.entity.UserBaseEntity;
import org.springblade.modules.personal.vo.UserBaseVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;

/**
 * 基本用户字段 服务类
 *
 * @author BladeX
 * @since 2023-03-22
 */
public interface IUserBaseService extends BaseService<UserBaseEntity> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param userBase
	 * @return
	 */
	IPage<UserBaseVO> selectUserBasePage(IPage<UserBaseVO> page, UserBaseVO userBase);


	/**
	 * 根据bladeUserId查询用户扩展信息
	 */
	UserBaseEntity selectByUserId(Long userId);
	/**
	 * 根据身份证查询
	 * 现在userNumber也等于idcard
	 */
	UserBaseEntity selectByIdcard(String idCard);
	/**
	 * 获取学员列表 分页
	 * 用于班级绑定学员
	 * @param page
	 * @param userBase
	 * @return
	 */
	IPage<UserBaseVO> selectUserPage(IPage<UserBaseVO> page, UserBaseVO userBase);

	/**
	 * 获取考试学员的信息
	 * 用于绑定考试的(考试与学员绑定)
	 * @param page
	 * @param userBase
	 * @return
	 */
	IPage<UserBaseVO> selectExamStudentPage(IPage<UserBaseVO> page, UserBaseVO userBase);

	UserBaseVO getUserInfo(Long userId);

	IPage<UserBaseVO> selectUserByDeptsAndIdcard(IPage<UserBaseVO> page, UserBaseVO userBaseVO);

	/**
	 * 用户添加积分和学时 并且添加年度积分
	 * 所有积分的获取都要走这个方法
	 */
	boolean addPeriodAndIntegral(Long userId,Float integral,Integer period);

	/**
	 * 根据用户名模糊查询
	 */
	List<UserBaseEntity> listByUserName(String userName);

	/**
	 * 根据用户名精准匹配
	 */
	UserBaseEntity selectByUserName(String userName);
}
